using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions.SettingGroups;
using Entity.StoreProcedure;
using BusinessObjects;
using System.Data;
namespace BusinessObjects.BO_GetObjects 
{
	public static class BO_SettingGroups
	{
		public static DataTable SelectAll(int status)
		{
			try
			{
				BOSettingGroups_Select_All action = new BOSettingGroups_Select_All();
				usp_SettingGroups_Select_All entity = new usp_SettingGroups_Select_All();
				entity.STATUS = status;
				return action.ExecuteAndReturnDataTable(entity);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public static DataTable SelectTop(int rows, int status)
		{
			try
			{
				BOSettingGroups_Select_Top action = new BOSettingGroups_Select_Top();
				usp_SettingGroups_Select_Top entity = new usp_SettingGroups_Select_Top();
				entity.NUMBERRECORD = rows;
				entity.STATUS = status;
				return action.ExecuteAndReturnDataTable(entity);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public static DataTable Search(int  setting_group_id)
		{
			try
			{
				BOSettingGroups_Search action = new BOSettingGroups_Search();
				usp_SettingGroups_Search entity = new usp_SettingGroups_Search();
				entity.SETTING_GROUP_ID = setting_group_id;
				return action.ExecuteAndReturnDataTable(entity);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public static DataTable SelectWithPaged(int startIndex, int pageCount, int status)
		{
			try
			{
				BOSettingGroups_Select_WithPaged action = new BOSettingGroups_Select_WithPaged ();
				usp_SettingGroups_Select_WithPaged entity = new usp_SettingGroups_Select_WithPaged ();
				entity.STARTINDEX = startIndex;
				entity.MAXRECORDS = pageCount;
				entity.STATUS = status;
				return action.ExecuteAndReturnDataTable(entity);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public static string Insert( string short_setting_name, string full_setting_name, string short_setting_description, string full_setting_description, int sort_display, DateTime created_date, string created_by, DateTime modify_date, string modify_by, bool status)
		{
			try
			{
				BOSettingGroups_Insert action = new BOSettingGroups_Insert();
				usp_SettingGroups_Insert entity = new usp_SettingGroups_Insert();
				entity.SHORT_SETTING_NAME = short_setting_name;
				entity.FULL_SETTING_NAME = full_setting_name;
				entity.SHORT_SETTING_DESCRIPTION = short_setting_description;
				entity.FULL_SETTING_DESCRIPTION = full_setting_description;
				entity.SORT_DISPLAY = sort_display;
				entity.CREATED_DATE = created_date;
				entity.CREATED_BY = created_by;
				entity.MODIFY_DATE = modify_date;
				entity.MODIFY_BY = modify_by;
				entity.STATUS = status;
				return action.ExecuteAndReturnStringValue(entity);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public static string Update( int setting_group_id, string short_setting_name, string full_setting_name, string short_setting_description, string full_setting_description, int sort_display, DateTime created_date, string created_by, DateTime modify_date, string modify_by, bool status)
		{
			try
			{
				BOSettingGroups_Update action = new BOSettingGroups_Update();
				usp_SettingGroups_Update entity = new usp_SettingGroups_Update();
				entity.SETTING_GROUP_ID = setting_group_id;
				entity.SHORT_SETTING_NAME = short_setting_name;
				entity.FULL_SETTING_NAME = full_setting_name;
				entity.SHORT_SETTING_DESCRIPTION = short_setting_description;
				entity.FULL_SETTING_DESCRIPTION = full_setting_description;
				entity.SORT_DISPLAY = sort_display;
				entity.CREATED_DATE = created_date;
				entity.CREATED_BY = created_by;
				entity.MODIFY_DATE = modify_date;
				entity.MODIFY_BY = modify_by;
				entity.STATUS = status;
				return action.ExecuteAndReturnStringValue(entity);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public static bool Delete(int setting_group_id)
		{
			try
			{
				BOSettingGroups_Delete action = new BOSettingGroups_Delete();
				usp_SettingGroups_Delete entity = new usp_SettingGroups_Delete();
				entity.SETTING_GROUP_ID = setting_group_id;
				return action.ExecuteAndReturnBooleanValue(entity);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public static bool Restore(int setting_group_id)
		{
			try
			{
				BOSettingGroups_Restore action = new BOSettingGroups_Restore();
				usp_SettingGroups_Restore entity = new usp_SettingGroups_Restore();
				entity.SETTING_GROUP_ID = setting_group_id;
				return action.ExecuteAndReturnBooleanValue(entity);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
	}
}

